<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:system="clr-namespace:System;assembly=mscorlib"
                    xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf;assembly=MaterialDesignThemes.Wpf"
                    xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters;assembly=MaterialDesignThemes.Wpf"
                    xmlns:dentalConverters="clr-namespace:DentalConfig.Converters;assembly=DentalConfig"
                    xmlns:guiHelper="clr-namespace:DentalGUIHelper;assembly=DentalConfig">

  <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="MaterialDesignTheme.ValidationErrorTemplate.xaml" />
    <ResourceDictionary Source="MaterialDesignTheme.Button.xaml" />
    <ResourceDictionary Source="../Brushes/Fonts.xaml"/>
    <ResourceDictionary Source="../Brushes/MaterialDesign/MaterialDesignTheme.Theme.xaml"/>
  </ResourceDictionary.MergedDictionaries>

  <converters:TextFieldHintVisibilityConverter x:Key="TextFieldHintVisibilityConverter" />
  <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
  <dentalConverters:IsStringNullOrEmptyConverter x:Key="StringNullOrEmpty"/>
  <dentalConverters:BrushToTransmittantBrushConverter x:Key="BrushToTransmittantBrushConverter"/>

  <ControlTemplate x:Key="MaterialDesignMinimalistTextBoxTemplate" TargetType="{x:Type TextBox}">
    <Grid>
      <Border x:Name="border"
              BorderBrush="{TemplateBinding BorderBrush}"
              BorderThickness="{TemplateBinding BorderThickness}"
              Background="{TemplateBinding Background}"
              SnapsToDevicePixels="True"
              Padding="0,2">
        <ScrollViewer x:Name="PART_ContentHost" Focusable="false"
                      HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"
                      SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                      UseLayoutRounding="{TemplateBinding UseLayoutRounding}">
          <ScrollViewer.Resources>
            <Style x:Key="{x:Type TextBlock}" BasedOn="{StaticResource ControlContentTextblock}" TargetType="{x:Type TextBlock}"/>
          </ScrollViewer.Resources>
        </ScrollViewer>
      </Border>
      <Line x:Name="DashedLine" VerticalAlignment="Bottom" Visibility="Collapsed"
          StrokeThickness="1.25" StrokeDashArray="1,2.5" StrokeDashCap="Round"
          X1="0" X2="{Binding ActualWidth, ElementName=border}" Y1="0" Y2="0"
          Stroke="{TemplateBinding BorderBrush}" Opacity="{StaticResource DisabledOpacity}" />
      <wpf:Underline x:Name="Underline" Visibility="{Binding Path=(wpf:TextFieldAssist.DecorationVisibility), RelativeSource={RelativeSource TemplatedParent}}"
                     CornerRadius="{Binding Path=(wpf:TextFieldAssist.UnderlineCornerRadius), RelativeSource={RelativeSource TemplatedParent}}" />
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="IsKeyboardFocused" Value="true">
        <Setter TargetName="Underline" Property="IsActive" Value="True"/>
      </Trigger>
      <Trigger Property="IsEnabled" Value="false">
        <Setter TargetName="DashedLine" Property="Visibility" Value="Visible" />
        <Setter TargetName="border" Property="BorderBrush" Value="Transparent" />
        <Setter TargetName="PART_ContentHost" Property="Opacity" Value="{StaticResource DisabledOpacity}" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>

  <ControlTemplate x:Key="MaterialDesignDefaultTextBoxTemplate" TargetType="{x:Type TextBox}">
    <Grid>
      <VisualStateManager.VisualStateGroups>
        <VisualStateGroup x:Name="FocusStates">
          <VisualState x:Name="Focused">
            <Storyboard>
              <DoubleAnimation Storyboard.TargetProperty="ScaleX" Storyboard.TargetName="ScaleTransform" From="0" To="1" Duration="0:0:0.3">
                <DoubleAnimation.EasingFunction>
                  <SineEase EasingMode="EaseOut" />
                </DoubleAnimation.EasingFunction>
              </DoubleAnimation>
              <DoubleAnimation Storyboard.TargetProperty="ScaleY" Storyboard.TargetName="ScaleTransform" From="0" To="1" Duration="0:0:0.3">
                <DoubleAnimation.EasingFunction>
                  <SineEase EasingMode="EaseOut" />
                </DoubleAnimation.EasingFunction>
              </DoubleAnimation>
              <DoubleAnimation Storyboard.TargetProperty="ScaleX" Storyboard.TargetName="ScaleTransform" To="0" BeginTime="0:0:0.45" Duration="0" />
              <DoubleAnimation Storyboard.TargetProperty="ScaleY" Storyboard.TargetName="ScaleTransform" To="0" BeginTime="0:0:0.45" Duration="0" />
            </Storyboard>
          </VisualState>
          <VisualState x:Name="Unfocused">
            <Storyboard>
              <DoubleAnimation Storyboard.TargetProperty="ScaleX" Storyboard.TargetName="ScaleTransform" To="0" Duration="0" />
              <DoubleAnimation Storyboard.TargetProperty="ScaleY" Storyboard.TargetName="ScaleTransform" To="0" Duration="0" />
            </Storyboard>
          </VisualState>
        </VisualStateGroup>
      </VisualStateManager.VisualStateGroups>
      <Border HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
              Background="{TemplateBinding Foreground}"
              Opacity="0.08"
              CornerRadius="{Binding Path=(wpf:TextFieldAssist.TextFieldCornerRadius), RelativeSource={RelativeSource TemplatedParent}}"
              Visibility="{Binding Path=(wpf:TextFieldAssist.RippleOnFocusEnabled), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}"
              RenderTransformOrigin="0.5,0.5">
        <Border.RenderTransform>
          <ScaleTransform x:Name="ScaleTransform" ScaleX="0" ScaleY="0" />
        </Border.RenderTransform>
      </Border>
      <Border x:Name="textFieldBoxBorder"
              CornerRadius="{Binding Path=(wpf:TextFieldAssist.TextFieldCornerRadius), RelativeSource={RelativeSource TemplatedParent}}"
              SnapsToDevicePixels="True">
        <Grid x:Name="borderGrid">
          <Border x:Name="border"
                  BorderBrush="{TemplateBinding BorderBrush}"
                  BorderThickness="{TemplateBinding BorderThickness}"
                  Background="{TemplateBinding Background}"
                  SnapsToDevicePixels="True"
                  Padding="0 4 0 2">
            <Grid x:Name="textFieldGrid"
                  Margin="{TemplateBinding Padding}"
                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                  MinWidth="1">
              <DockPanel>
                <TextBlock x:Name="Suffix"
                           DockPanel.Dock="Right"
                           Text="{Binding Path=(guiHelper:TextboxHelper.Suffix), RelativeSource={RelativeSource TemplatedParent}}"
                           FontSize="{TemplateBinding FontSize}"
                           Margin="4,0,0,0"
                           Opacity="{Binding Path=(wpf:HintAssist.HintOpacity), RelativeSource={RelativeSource TemplatedParent}}"
                           Visibility="Collapsed"/>
                <Grid>
                  <ScrollViewer x:Name="PART_ContentHost" Focusable="false"
                                HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                UseLayoutRounding="{TemplateBinding UseLayoutRounding}">
                    <ScrollViewer.Resources>
                      <Style x:Key="{x:Type TextBlock}" BasedOn="{StaticResource ControlContentTextblock}" TargetType="{x:Type TextBlock}"/>
                    </ScrollViewer.Resources>
                  </ScrollViewer>
                  <wpf:SmartHint x:Name="Hint"
                                 HintProxy="{Binding RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static converters:HintProxyFabricConverter.Instance}}"
                                 FontSize="{TemplateBinding FontSize}"
                                 Padding="{TemplateBinding Padding}"
                                 HintOpacity="{Binding Path=(wpf:HintAssist.HintOpacity), RelativeSource={RelativeSource TemplatedParent}}"
                                 UseFloating="{Binding Path=(wpf:HintAssist.IsFloating), RelativeSource={RelativeSource TemplatedParent}}"
                                 FloatingScale="{Binding Path=(wpf:HintAssist.FloatingScale), RelativeSource={RelativeSource TemplatedParent}}"
                                 FloatingOffset="{Binding Path=(wpf:HintAssist.FloatingOffset), RelativeSource={RelativeSource TemplatedParent}}">
                    <wpf:SmartHint.Resources>
                      <system:Double x:Key="DisabledOpacity">1</system:Double><!--TextBlock disabled opacity should not be applied on top of HintOpacity-->
                    </wpf:SmartHint.Resources>
                    <wpf:SmartHint.Hint>
                      <StackPanel Orientation="Horizontal">
                        <ContentPresenter Content="{Binding Path=(wpf:HintAssist.Hint), RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="Center"/>
                        <TextBlock Text="*" Margin="4,0,0,0" VerticalAlignment="Center" Visibility="{Binding Path=(guiHelper:TextboxHelper.IsRequired), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}"/>
                      </StackPanel>
                    </wpf:SmartHint.Hint>
                  </wpf:SmartHint>
                </Grid>
              </DockPanel>
              <Button x:Name="PART_ClearText"
                      Style="{StaticResource MaterialDesignFlatOverlayButton}"
                      Foreground="{TemplateBinding Foreground}"
                      HorizontalAlignment="Right"
                      Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(guiHelper:TextboxHelper.ClearTextButton), Converter={StaticResource BooleanToVisibilityConverter}}"
                      IsTabStop="False"
                      Width="20"
                      MinHeight="20"
                      MaxHeight="20"
                      Margin="0 0 3 0"
                      Padding="0"
                      HorizontalContentAlignment="Center"
                      VerticalContentAlignment="Center">
                <Image Source="{guiHelper:Icon ClearTextbox}" Width="10" Height="10" Stretch="Uniform"/>
              </Button>
            </Grid>
          </Border>
          <Border x:Name="textFieldBoxBottomLine"
                  Background="{TemplateBinding BorderBrush}"
                  Height="0"
                  CornerRadius="{Binding Path=(wpf:TextFieldAssist.UnderlineCornerRadius), RelativeSource={RelativeSource TemplatedParent}}"
                  HorizontalAlignment="Stretch"
                  VerticalAlignment="Bottom"
                  SnapsToDevicePixels="True" />
          <Line x:Name="DashedLine" VerticalAlignment="Bottom" Visibility="Collapsed"
                StrokeThickness="1.25" StrokeDashArray="1,2.5" StrokeDashCap="Round"
                X1="0" X2="{Binding ActualWidth, ElementName=border}" Y1="0" Y2="0"
                Stroke="{TemplateBinding BorderBrush}" Opacity="{StaticResource DisabledOpacity}" />
          <wpf:Underline x:Name="Underline" Visibility="{Binding Path=(wpf:TextFieldAssist.DecorationVisibility), RelativeSource={RelativeSource TemplatedParent}}"
                         CornerRadius="{Binding Path=(wpf:TextFieldAssist.UnderlineCornerRadius), RelativeSource={RelativeSource TemplatedParent}}" />
        </Grid>
      </Border>
    </Grid>
    <ControlTemplate.Triggers>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="wpf:HintAssist.IsFloating" Value="True" />
          <Condition Property="IsKeyboardFocused" Value="True" />
        </MultiTrigger.Conditions>
        <Setter TargetName="Hint" Property="Foreground" Value="{DynamicResource MidContrastPrimaryBrush}" />
        <Setter TargetName="Hint" Property="HintOpacity" Value="1" />
      </MultiTrigger>
      <MultiDataTrigger>
        <MultiDataTrigger.Conditions>
          <Condition Binding="{Binding Path=(wpf:HintAssist.IsFloating), RelativeSource={RelativeSource Self}}" Value="True" />
          <Condition Binding="{Binding Path=(wpf:HintAssist.Hint), RelativeSource={RelativeSource Self}, Converter={StaticResource StringNullOrEmpty}}" Value="False"/>
        </MultiDataTrigger.Conditions>
        <Setter TargetName="border" Property="Margin" Value="0 20 0 0" />
      </MultiDataTrigger>
      <MultiDataTrigger>
        <MultiDataTrigger.Conditions>
          <Condition Binding="{Binding Path=(wpf:HintAssist.IsFloating), RelativeSource={RelativeSource Self}}" Value="False" />
          <Condition Binding="{Binding Path=(guiHelper:TextboxHelper.HintIsVisible), RelativeSource={RelativeSource Self}}" Value="False"/>
        </MultiDataTrigger.Conditions>
        <Setter TargetName="Hint" Property="Visibility" Value="Collapsed" />
      </MultiDataTrigger>
      <Trigger Property="wpf:TextFieldAssist.HasFilledTextField" Value="True">
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter TargetName="textFieldBoxBorder" Property="Background" Value="{Binding Background, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
        <Setter TargetName="textFieldBoxBorder" Property="Padding" Value="0" />
        <Setter TargetName="textFieldGrid" Property="Margin" Value="4,0" />
        <Setter TargetName="border" Property="BorderThickness" Value="0" />
        <Setter TargetName="border" Property="Cursor" Value="IBeam" />
        <Setter TargetName="Hint" Property="Margin" Value="{Binding Path=Margin, ElementName=PART_ContentHost}" />
      </Trigger>
      <Trigger Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True">
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter TargetName="borderGrid" Property="Margin" Value="-2" />
        <Setter TargetName="textFieldBoxBorder" Property="Background" Value="Transparent" />
        <Setter TargetName="textFieldBoxBorder" Property="BorderThickness" Value="1" />
        <Setter TargetName="textFieldBoxBorder" Property="BorderBrush" Value="{Binding BorderBrush, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
        <Setter TargetName="textFieldBoxBorder" Property="Opacity" Value="0.74" />
        <Setter TargetName="textFieldBoxBorder" Property="Padding" Value="0,0,0,0" />
        <Setter TargetName="textFieldBoxBorder" Property="Margin" Value="-1" />
        <Setter TargetName="textFieldGrid" Property="Margin" Value="8,0,8,0" />
        <Setter TargetName="border" Property="BorderThickness" Value="0" />
        <Setter TargetName="border" Property="Cursor" Value="IBeam" />
        <Setter TargetName="Underline" Property="Visibility" Value="Collapsed" />
        <Setter TargetName="Hint" Property="Margin" Value="{Binding Path=Margin, ElementName=PART_ContentHost}" />
        <Setter TargetName="PART_ContentHost" Property="Margin" Value="0,8,0,8" />
      </Trigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter TargetName="textFieldBoxBottomLine" Property="Height" Value="0" />
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsEnabled" Value="false" />
          <Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True" />
        </MultiTrigger.Conditions>
        <Setter TargetName="textFieldBoxBorder" Property="BorderBrush" Value="{Binding Foreground, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
        <Setter TargetName="textFieldBoxBorder" Property="Opacity" Value="{StaticResource DisabledOpacity}" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsEnabled" Value="false" />
          <Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="False" />
        </MultiTrigger.Conditions>
        <Setter TargetName="border" Property="BorderBrush" Value="Transparent" />
        <Setter TargetName="PART_ContentHost" Property="Opacity" Value="{StaticResource DisabledOpacity}" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsEnabled" Value="false" />
          <Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="False" />
          <Condition Property="wpf:TextFieldAssist.HasFilledTextField" Value="False" />
        </MultiTrigger.Conditions>
        <Setter TargetName="DashedLine" Property="Visibility" Value="Visible" />
      </MultiTrigger>
      <Trigger Property="IsKeyboardFocused" Value="true">
        <Setter TargetName="Underline" Property="IsActive" Value="True"/>
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsKeyboardFocused" Value="True" />
          <Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True" />
        </MultiTrigger.Conditions>
        <Setter TargetName="textFieldBoxBorder" Property="Margin" Value="-2" />
        <Setter TargetName="textFieldBoxBorder" Property="BorderThickness" Value="2" />
        <Setter TargetName="textFieldBoxBorder" Property="BorderBrush" Value="{DynamicResource MidContrastPrimaryBrush}" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsKeyboardFocused" Value="True" />
          <Condition Property="wpf:TextFieldAssist.HasFilledTextField" Value="True" />
        </MultiTrigger.Conditions>
        <Setter TargetName="textFieldBoxBottomLine" Property="Height" Value="2" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
          <Condition Property="wpf:TextFieldAssist.HasFilledTextField" Value="False" />
          <Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="False" />
          <Condition Property="wpf:TextFieldAssist.NewSpecHighlightingEnabled" Value="False" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" Value="{DynamicResource MidContrastPrimaryBrush}"/>
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
          <Condition Property="wpf:TextFieldAssist.HasFilledTextField" Value="False" />
          <Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="False" />
          <Condition Property="wpf:TextFieldAssist.NewSpecHighlightingEnabled" Value="True" />
        </MultiTrigger.Conditions>
        <Setter TargetName="border" Property="BorderThickness" Value="0,0,0,2" />
        <Setter TargetName="border" Property="Padding" Value="0,4,0,3" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
          <Condition Property="wpf:TextFieldAssist.HasFilledTextField" Value="True" />
        </MultiTrigger.Conditions>
        <Setter TargetName="textFieldBoxBorder" Property="Background" Value="{Binding Background, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
        <Setter TargetName="textFieldBoxBottomLine" Property="Height" Value="1" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
          <Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True" />
        </MultiTrigger.Conditions>
        <Setter TargetName="textFieldBoxBorder" Property="Margin" Value="-2" />
        <Setter TargetName="textFieldBoxBorder" Property="BorderThickness" Value="2" />
      </MultiTrigger>
      <Trigger Property="Validation.HasError" Value="true">
        <Setter Property="BorderBrush" Value="{DynamicResource ValidationErrorBrush}"/>
        <Setter TargetName="Underline" Property="Background" Value="{DynamicResource ValidationErrorBrush}"/>
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="Validation.HasError" Value="True" />
          <Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True" />
        </MultiTrigger.Conditions>
        <Setter TargetName="textFieldBoxBorder" Property="Margin" Value="-2" />
        <Setter TargetName="textFieldBoxBorder" Property="BorderThickness" Value="2" />
        <Setter TargetName="textFieldBoxBorder" Property="BorderBrush" Value="{DynamicResource ValidationErrorBrush}" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="Validation.HasError" Value="True"/>
          <Condition Property="wpf:ValidationAssist.Suppress" Value="True"/>
        </MultiTrigger.Conditions>
        <Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)/ErrorContent}"/>
      </MultiTrigger>
      <DataTrigger Binding="{Binding Path=(guiHelper:TextboxHelper.Suffix), RelativeSource={RelativeSource Self}, Converter={StaticResource StringNullOrEmpty}}" Value="False">
        <Setter TargetName="Suffix" Property="Visibility" Value="Visible"/>
      </DataTrigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>

  <ControlTemplate x:Key="MaterialDesignOutlinedFrameLabelTextBoxTemplate" TargetType="{x:Type TextBox}">
    <Grid x:Name="templateRoot"
          Background="{TemplateBinding Background}"
          ToolTip="{Binding Path=ToolTip, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}, FallbackValue={x:Null}}"
          SnapsToDevicePixels="True">
      <Grid HorizontalAlignment="Left" VerticalAlignment="Top" MinHeight="20" Margin="24,0" IsHitTestVisible="False">
        <ContentPresenter x:Name="frameLabel"
        				VerticalAlignment="Center"
        				Content="{TemplateBinding guiHelper:TextboxHelper.FrameLabel}"
        				TextElement.Foreground="{TemplateBinding BorderBrush}"
                Opacity="0.76">
          <ContentPresenter.Resources>
            <system:Double x:Key="DisabledOpacity">1</system:Double><!--TextBlock disabled opacity should not be applied on top of HintOpacity-->
          </ContentPresenter.Resources>
        </ContentPresenter>
	  </Grid>
      <Grid x:Name="InnerRoot" Margin="0,12,0,0">
        <Grid.OpacityMask>
          <DrawingBrush Stretch="None" AlignmentX="Left" AlignmentY="Top">
            <DrawingBrush.Drawing>
              <GeometryDrawing>
                <GeometryDrawing.Brush>
                    <SolidColorBrush Color="Blue"/>
                </GeometryDrawing.Brush>
                <GeometryDrawing.Geometry>
                  <GeometryGroup FillRule="EvenOdd" >
                    <RectangleGeometry Rect="0,0,1,1">
                      <RectangleGeometry.Transform>
                        <TransformGroup>
                          <ScaleTransform ScaleX="{Binding ActualWidth, ElementName=templateRoot}"
                                          ScaleY="{Binding ActualHeight, ElementName=templateRoot}" />
                        </TransformGroup>
                      </RectangleGeometry.Transform>
                    </RectangleGeometry>
                    <RectangleGeometry Rect="0,0,1,1">
                      <RectangleGeometry.Transform>
                        <TransformGroup>
                          <ScaleTransform ScaleX="{Binding ActualWidth, ElementName=frameLabel, Converter={StaticResource MathAddConverter}, ConverterParameter=16}"
                                          ScaleY="4" />
                          <TranslateTransform X="16" Y="0"/>
                        </TransformGroup>
                      </RectangleGeometry.Transform>
                    </RectangleGeometry>
                  </GeometryGroup>
                </GeometryDrawing.Geometry>
              </GeometryDrawing>
            </DrawingBrush.Drawing>
          </DrawingBrush>
        </Grid.OpacityMask>
        <VisualStateManager.VisualStateGroups>
          <VisualStateGroup x:Name="FocusStates">
            <VisualState x:Name="Focused">
              <Storyboard>
                <DoubleAnimation Storyboard.TargetProperty="ScaleX" Storyboard.TargetName="ScaleTransform" From="0" To="1" Duration="0:0:0.3">
                  <DoubleAnimation.EasingFunction>
                    <SineEase EasingMode="EaseOut" />
                  </DoubleAnimation.EasingFunction>
                </DoubleAnimation>
                <DoubleAnimation Storyboard.TargetProperty="ScaleY" Storyboard.TargetName="ScaleTransform" From="0" To="1" Duration="0:0:0.3">
                  <DoubleAnimation.EasingFunction>
                    <SineEase EasingMode="EaseOut" />
                  </DoubleAnimation.EasingFunction>
                </DoubleAnimation>
                <DoubleAnimation Storyboard.TargetProperty="ScaleX" Storyboard.TargetName="ScaleTransform" To="0" BeginTime="0:0:0.45" Duration="0" />
                <DoubleAnimation Storyboard.TargetProperty="ScaleY" Storyboard.TargetName="ScaleTransform" To="0" BeginTime="0:0:0.45" Duration="0" />
              </Storyboard>
            </VisualState>
            <VisualState x:Name="Unfocused">
              <Storyboard>
                <DoubleAnimation Storyboard.TargetProperty="ScaleX" Storyboard.TargetName="ScaleTransform" To="0" Duration="0" />
                <DoubleAnimation Storyboard.TargetProperty="ScaleY" Storyboard.TargetName="ScaleTransform" To="0" Duration="0" />
              </Storyboard>
            </VisualState>
          </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <Border HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                Background="{TemplateBinding Foreground}"
                Opacity="0.08"
                CornerRadius="{Binding Path=(wpf:TextFieldAssist.TextFieldCornerRadius), RelativeSource={RelativeSource TemplatedParent}}"
                Visibility="{Binding Path=(wpf:TextFieldAssist.RippleOnFocusEnabled), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}"
                RenderTransformOrigin="0.5,0.5">
          <Border.RenderTransform>
            <ScaleTransform x:Name="ScaleTransform" ScaleX="0" ScaleY="0" />
          </Border.RenderTransform>
        </Border>
        <Border x:Name="textFieldBoxBorder"
                SnapsToDevicePixels="True">
          <Grid x:Name="borderGrid">
            <Border x:Name="border"
                    BorderBrush="{Binding Path=BorderBrush, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BrushToTransmittantBrushConverter}, ConverterParameter=0.76}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Background="{TemplateBinding Background}"
                    CornerRadius="{TemplateBinding wpf:TextFieldAssist.TextFieldCornerRadius}"
                    SnapsToDevicePixels="True">
              <Grid x:Name="textFieldGrid"
                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                    MinWidth="1">
                <DockPanel>
                  <TextBlock x:Name="Suffix"
                             DockPanel.Dock="Right"
                             Text="{Binding Path=(guiHelper:TextboxHelper.Suffix), RelativeSource={RelativeSource TemplatedParent}}"
                             FontSize="{TemplateBinding FontSize}"
                             Margin="4,0,0,0"
                             Opacity="{Binding Path=(wpf:HintAssist.HintOpacity), RelativeSource={RelativeSource TemplatedParent}}"
                             Visibility="Collapsed"/>
                  <Grid>
                    <ScrollViewer x:Name="PART_ContentHost" Focusable="false"
                                  HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"
                                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                  UseLayoutRounding="{TemplateBinding UseLayoutRounding}">
                      <ScrollViewer.Resources>
                        <system:Double x:Key="DisabledOpacity">1</system:Double><!--TextBlock disabled opacity should not be applied on top of HintOpacity-->
                      </ScrollViewer.Resources>
                    </ScrollViewer>
                    <wpf:SmartHint x:Name="Hint"
                                   HintProxy="{Binding RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static converters:HintProxyFabricConverter.Instance}}"
                                   FontSize="{TemplateBinding FontSize}"
                                   Padding="{TemplateBinding Padding}"
                                   HintOpacity="{Binding Path=(wpf:HintAssist.HintOpacity), RelativeSource={RelativeSource TemplatedParent}}"
                                   UseFloating="{Binding Path=(wpf:HintAssist.IsFloating), RelativeSource={RelativeSource TemplatedParent}}"
                                   FloatingScale="{Binding Path=(wpf:HintAssist.FloatingScale), RelativeSource={RelativeSource TemplatedParent}}"
                                   FloatingOffset="{Binding Path=(wpf:HintAssist.FloatingOffset), RelativeSource={RelativeSource TemplatedParent}}">
                      <wpf:SmartHint.Resources>
                        <system:Double x:Key="DisabledOpacity">1</system:Double><!--TextBlock disabled opacity should not be applied on top of HintOpacity-->
                      </wpf:SmartHint.Resources>
                      <wpf:SmartHint.Hint>
                        <StackPanel Orientation="Horizontal">
                          <ContentPresenter Content="{Binding Path=(wpf:HintAssist.Hint), RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="Center"/>
                          <TextBlock Text="*" Margin="4,0,0,0" VerticalAlignment="Center" Visibility="{Binding Path=(guiHelper:TextboxHelper.IsRequired), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}"/>
                        </StackPanel>
                      </wpf:SmartHint.Hint>
                    </wpf:SmartHint>
                  </Grid>
                </DockPanel>
                <Button x:Name="PART_ClearText"
                        Style="{StaticResource MaterialDesignFlatButton}"
                        HorizontalAlignment="Right"
                        Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(guiHelper:TextboxHelper.ClearTextButton), Converter={StaticResource BooleanToVisibilityConverter}}"
                        IsTabStop="False"
                        Width="20"
                        MinHeight="20"
                        MaxHeight="20"
                        Margin="0 0 3 0"
                        Padding="0"
                        HorizontalContentAlignment="Center"
                        VerticalContentAlignment="Center">
                  <Image Source="{guiHelper:Icon ClearTextbox}" Width="10" Height="10" Stretch="Uniform"/>
                </Button>
              </Grid>
            </Border>
            <Border x:Name="textFieldBoxBottomLine"
                    Background="{TemplateBinding BorderBrush}"
                    Height="0"
                    CornerRadius="{Binding Path=(wpf:TextFieldAssist.UnderlineCornerRadius), RelativeSource={RelativeSource TemplatedParent}}"
                    HorizontalAlignment="Stretch"
                    VerticalAlignment="Bottom"
                    SnapsToDevicePixels="True" />
            <wpf:Underline x:Name="Underline" Visibility="{Binding Path=(wpf:TextFieldAssist.DecorationVisibility), RelativeSource={RelativeSource TemplatedParent}}"
                           CornerRadius="{Binding Path=(wpf:TextFieldAssist.UnderlineCornerRadius), RelativeSource={RelativeSource TemplatedParent}}" />
          </Grid>
        </Border>
      </Grid>
    </Grid>
    <ControlTemplate.Triggers>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="wpf:HintAssist.IsFloating" Value="True" />
          <Condition Property="IsKeyboardFocused" Value="True" />
        </MultiTrigger.Conditions>
        <Setter TargetName="Hint" Property="Foreground" Value="{DynamicResource MidContrastPrimaryBrush}" />
        <Setter TargetName="Hint" Property="HintOpacity" Value="1" />
      </MultiTrigger>
      <MultiDataTrigger>
        <MultiDataTrigger.Conditions>
          <Condition Binding="{Binding Path=(wpf:HintAssist.IsFloating), RelativeSource={RelativeSource Self}}" Value="True" />
          <Condition Binding="{Binding Path=(wpf:HintAssist.Hint), RelativeSource={RelativeSource Self}, Converter={StaticResource StringNullOrEmpty}}" Value="False"/>
        </MultiDataTrigger.Conditions>
        <Setter TargetName="border" Property="Margin" Value="0 20 0 0" />
      </MultiDataTrigger>
      <MultiDataTrigger>
        <MultiDataTrigger.Conditions>
          <Condition Binding="{Binding Path=(wpf:HintAssist.IsFloating), RelativeSource={RelativeSource Self}}" Value="False" />
          <Condition Binding="{Binding Path=(guiHelper:TextboxHelper.HintIsVisible), RelativeSource={RelativeSource Self}}" Value="False"/>
        </MultiDataTrigger.Conditions>
        <Setter TargetName="Hint" Property="Visibility" Value="Collapsed" />
      </MultiDataTrigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter TargetName="templateRoot" Property="Opacity" Value="{StaticResource DisabledOpacity}"/>
      </Trigger>
      <Trigger Property="IsKeyboardFocused" Value="true">
        <Setter TargetName="Underline" Property="IsActive" Value="True"/>
        <Setter Property="Margin" TargetName="textFieldGrid" Value="-1"/>
        <Setter TargetName="border" Property="BorderBrush" Value="{Binding Path=BorderBrush, RelativeSource={RelativeSource TemplatedParent}}"/>
        <Setter TargetName="frameLabel" Property="Opacity" Value="1"/>
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsKeyboardFocused" Value="True" />
          <Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True" />
        </MultiTrigger.Conditions>
        <Setter TargetName="textFieldBoxBorder" Property="Margin" Value="-2" />
        <Setter TargetName="textFieldBoxBorder" Property="BorderThickness" Value="2" />
        <Setter TargetName="textFieldBoxBorder" Property="BorderBrush" Value="{DynamicResource MidContrastPrimaryBrush}" />
        <Setter TargetName="frameLabel" Property="Opacity" Value="1"/>
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsKeyboardFocused" Value="True" />
          <Condition Property="wpf:TextFieldAssist.HasFilledTextField" Value="True" />
        </MultiTrigger.Conditions>
        <Setter TargetName="textFieldBoxBottomLine" Property="Height" Value="2" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
          <Condition Property="wpf:TextFieldAssist.HasFilledTextField" Value="False" />
          <Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="False" />
          <Condition Property="wpf:TextFieldAssist.NewSpecHighlightingEnabled" Value="False" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" Value="{DynamicResource MidContrastPrimaryBrush}"/>
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
          <Condition Property="wpf:TextFieldAssist.HasFilledTextField" Value="False" />
          <Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="False" />
          <Condition Property="wpf:TextFieldAssist.NewSpecHighlightingEnabled" Value="True" />
        </MultiTrigger.Conditions>
        <Setter TargetName="border" Property="BorderThickness" Value="0,0,0,2" />
        <Setter TargetName="border" Property="Padding" Value="0,4,0,3" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
          <Condition Property="wpf:TextFieldAssist.HasFilledTextField" Value="True" />
        </MultiTrigger.Conditions>
        <Setter TargetName="textFieldBoxBorder" Property="Background" Value="{Binding Background, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
        <Setter TargetName="textFieldBoxBottomLine" Property="Height" Value="1" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
          <Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True" />
        </MultiTrigger.Conditions>
        <Setter TargetName="textFieldBoxBorder" Property="Margin" Value="-2" />
        <Setter TargetName="textFieldBoxBorder" Property="BorderThickness" Value="2" />
      </MultiTrigger>
      <Trigger Property="Validation.HasError" Value="true">
        <Setter Property="BorderBrush" Value="{DynamicResource ValidationErrorBrush}"/>
        <Setter TargetName="Underline" Property="Background" Value="{DynamicResource ValidationErrorBrush}"/>
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="Validation.HasError" Value="True" />
          <Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True" />
        </MultiTrigger.Conditions>
        <Setter TargetName="textFieldBoxBorder" Property="Margin" Value="-2" />
        <Setter TargetName="textFieldBoxBorder" Property="BorderThickness" Value="2" />
        <Setter TargetName="textFieldBoxBorder" Property="BorderBrush" Value="{DynamicResource ValidationErrorBrush}" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="Validation.HasError" Value="True"/>
          <Condition Property="wpf:ValidationAssist.Suppress" Value="True"/>
        </MultiTrigger.Conditions>
        <Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)/ErrorContent}"/>
      </MultiTrigger>
      <DataTrigger Binding="{Binding Path=(guiHelper:TextboxHelper.Suffix), RelativeSource={RelativeSource Self}, Converter={StaticResource StringNullOrEmpty}}" Value="False">
        <Setter TargetName="Suffix" Property="Visibility" Value="Visible"/>
      </DataTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="true" />
          <Condition Property="Validation.HasError" Value="false" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderThickness" Value="2"/>
        <Setter Property="Margin" TargetName="textFieldGrid" Value="-1"/>
        <Setter TargetName="border" Property="BorderBrush" Value="{Binding Path=BorderBrush, RelativeSource={RelativeSource TemplatedParent}}"/>
        <Setter TargetName="frameLabel" Property="Opacity" Value="1"/>
      </MultiTrigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>

  <Style x:Key="MaterialDesignMinimalistTextBox" TargetType="{x:Type TextBox}">
    <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}"/>
    <Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextBoxBorder}" />
    <Setter Property="BorderThickness" Value="0 0 0 1"/>
    <Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="0 0 1 0" />
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="CaretBrush" Value="{Binding RelativeSource={RelativeSource Self}, Path=Foreground}"/>
    <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="VerticalContentAlignment" Value="Bottom"/>
    <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    <Setter Property="AllowDrop" Value="true"/>
    <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
    <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
    <Setter Property="TextBox.FontFamily" Value="{StaticResource MaterialDesignFont}"/>
    <Setter Property="Template" Value="{StaticResource MaterialDesignMinimalistTextBoxTemplate}"/>
    <!-- cludge the default context menu -->
    <Setter Property="ContextMenu">
      <Setter.Value>
        <ContextMenu>
          <MenuItem Command="Cut"/>
          <MenuItem Command="Copy"/>
          <MenuItem Command="Paste"/>
        </ContextMenu>
      </Setter.Value>
    </Setter>
    <Style.Triggers>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsInactiveSelectionHighlightEnabled" Value="true"/>
          <Condition Property="IsSelectionActive" Value="false"/>
        </MultiTrigger.Conditions>
        <Setter Property="SelectionBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}"/>
      </MultiTrigger>
    </Style.Triggers>
  </Style>

  <Style x:Key="MaterialDesignTextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource MaterialDesignMinimalistTextBox}">
    <Setter Property="Validation.ErrorTemplate" Value="{StaticResource MaterialDesignValidationErrorTemplate}"/>
    <Setter Property="wpf:ValidationAssist.Suppress" Value="True"/>
    <Setter Property="wpf:TextFieldAssist.IncludeSpellingSuggestions" Value="{Binding RelativeSource={RelativeSource Self}, Path=(SpellCheck.IsEnabled)}" />
    <Setter Property="wpf:TextFieldAssist.NewSpecHighlightingEnabled" Value="False" />
    <Setter Property="wpf:TextFieldAssist.RippleOnFocusEnabled" Value="False" />
    <Setter Property="wpf:HintAssist.Hint" Value="{Binding RelativeSource={RelativeSource Self}, Path=(guiHelper:TextboxHelper.Watermark)}" />
    <Style.Triggers>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsInactiveSelectionHighlightEnabled" Value="true"/>
          <Condition Property="IsSelectionActive" Value="false"/>
        </MultiTrigger.Conditions>
        <Setter Property="SelectionBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}"/>
      </MultiTrigger>
      <DataTrigger Binding="{Binding Path=(wpf:HintAssist.Hint), RelativeSource={RelativeSource Self}, Converter={StaticResource StringNullOrEmpty}}" Value="False">
        <Setter Property="Template" Value="{StaticResource MaterialDesignDefaultTextBoxTemplate}" />
      </DataTrigger>
      <Trigger Property="wpf:TextFieldAssist.HasFilledTextField" Value="True">
        <Setter Property="Template" Value="{StaticResource MaterialDesignDefaultTextBoxTemplate}" />
      </Trigger>
      <Trigger Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True">
        <Setter Property="Template" Value="{StaticResource MaterialDesignDefaultTextBoxTemplate}" />
      </Trigger>
      <Trigger Property="Validation.HasError" Value="True">
        <Setter Property="Template" Value="{StaticResource MaterialDesignDefaultTextBoxTemplate}" />
      </Trigger>
      <DataTrigger Binding="{Binding Path=(guiHelper:TextboxHelper.Suffix), RelativeSource={RelativeSource Self}, Converter={StaticResource StringNullOrEmpty}}" Value="False">
        <Setter Property="Template" Value="{StaticResource MaterialDesignDefaultTextBoxTemplate}" />
      </DataTrigger>
      <Trigger Property="guiHelper:TextboxHelper.ClearTextButton" Value="True">
        <Setter Property="Template" Value="{StaticResource MaterialDesignDefaultTextBoxTemplate}" />
      </Trigger>
      <Trigger Property="guiHelper:TextboxHelper.IsRequired" Value="True">
        <Setter Property="Template" Value="{StaticResource MaterialDesignDefaultTextBoxTemplate}" />
        <Setter Property="Validation.ErrorTemplate" Value="{StaticResource MaterialDesignValidationErrorNoAsteriskTemplate}" />
      </Trigger>
    </Style.Triggers>
  </Style>

  <Style x:Key="MaterialDesignFloatingHintTextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource MaterialDesignTextBox}">
    <Setter Property="wpf:HintAssist.IsFloating" Value="True"/>
  </Style>

  <Style x:Key="MaterialDesignFilledTextFieldTextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource MaterialDesignFloatingHintTextBox}">
    <Setter Property="wpf:TextFieldAssist.HasFilledTextField" Value="True" />
    <Setter Property="wpf:TextFieldAssist.RippleOnFocusEnabled" Value="True" />
    <Setter Property="wpf:TextFieldAssist.TextFieldCornerRadius" Value="4,4,0,0" />
    <Setter Property="wpf:TextFieldAssist.UnderlineCornerRadius" Value="0" />
    <Setter Property="Background" Value="{DynamicResource MaterialDesignZebraBackground}" />
  </Style>

  <Style x:Key="MaterialDesignOutlinedTextFieldTextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource MaterialDesignFloatingHintTextBox}">
    <Setter Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True" />
    <Setter Property="wpf:TextFieldAssist.TextFieldCornerRadius" Value="4" />
  </Style>

  <Style x:Key="MaterialDesignOutlinedFrameLabelTextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource MaterialDesignMinimalistTextBox}">
    <Setter Property="Template" Value="{StaticResource MaterialDesignOutlinedFrameLabelTextBoxTemplate}"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="Padding" Value="12"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="SnapsToDevicePixels" Value="True"/>
    <Setter Property="UseLayoutRounding" Value="True"/>
    <Setter Property="wpf:TextFieldAssist.TextFieldCornerRadius" Value="2" />
    <Setter Property="BorderBrush" Value="{Binding Foreground, RelativeSource={RelativeSource Self}, FallbackValue=Black}"/>
    <Setter Property="wpf:TextFieldAssist.DecorationVisibility" Value="Collapsed"/>
    <Setter Property="Validation.ErrorTemplate" Value="{StaticResource MaterialDesignValidationErrorTemplate}"/>
    <Setter Property="wpf:ValidationAssist.Suppress" Value="true" />
    <Style.Triggers>
      <Trigger Property="IsKeyboardFocused" Value="true">
        <Setter Property="BorderThickness" Value="2" />
        <Setter Property="BorderBrush" Value="{DynamicResource MidContrastPrimaryBrush}" />
      </Trigger>
      <Trigger Property="IsKeyboardFocusWithin" Value="true">
        <Setter Property="BorderThickness" Value="2" />
        <Setter Property="BorderBrush" Value="{DynamicResource MidContrastPrimaryBrush}" />
      </Trigger>
    </Style.Triggers>
  </Style>

  <Style x:Key="{x:Type TextBox}" BasedOn="{StaticResource MaterialDesignTextBox}" TargetType="{x:Type TextBox}" />

</ResourceDictionary>
